function get_post_popup() { if (jQuery(".dmach-popup").remove(), jQuery(".show_modal").length > 0) { var a = jQuery(".show_modal").eq(0).attr("data-modal-layout"), e = jQuery(".show_modal").eq(0).attr("data-modal-style"), t = jQuery(".show_modal").eq(0).attr("data-modal-postype"), o = (a = jQuery(".show_modal").eq(0).attr("data-modal-layout"), []), s = jQuery(".show_modal").eq(0).closest(".divi-filter-archive-loop").attr("data-posttype"); jQuery(".show_modal").each(function () { o.push(jQuery(this).attr("data-id")) }), jQuery(".et-l--body").length ? jQuery(".et-l--body").append('
') : jQuery("#page-container").append('
'); var i = { action: "divi_filter_get_post_modal_ajax_handler", post_ids: o.join(","), post_type: s, modal_layout: a, modal_postype: t }; jQuery(".show_modal").click(function (a) { a.preventDefault(), a.stopPropagation(); var e = jQuery(this).attr("data-id"), t = jQuery(this).attr("loading_animation_color"); "" !== t && jQuery("#loading-modal .line").each(function (a, e) { jQuery(this).css("background-color", t) }), jQuery("#post-modal-" + e).length ? jQuery("#post-modal-" + e).addClass("open") : (jQuery("#loading-modal").attr("modaldata-id", e), jQuery("#loading-modal").addClass("open")), jQuery("body").css("overflow", "hidden") }), jQuery.ajax({ url: filter_ajax_object.ajax_url, data: i, type: "POST", dataType: "JSON", success: function (a) { if (console.log(a), jQuery("body").find("#dmach-modal-wrapper:not(.loading)").remove(), jQuery("#dmach-modal-wrapper.loading").length || (jQuery(".et-l--body").length ? jQuery(".et-l--body").append('
') : jQuery("#page-container").append('
')), jQuery(".show_modal").each(function () { var e = jQuery(this).attr("data-id"); if (jQuery("#dmach-modal-wrapper").append('
' + a.content["show_modal_" + e] + '
'), jQuery("#post-modal-" + e).find(".et_pb_map_container").length > 0) { var t = {}, o = {}; jQuery("#post-modal-" + e).find(".et_pb_map_container").each(function () { o[e] = jQuery(this), "function" != typeof et_pb_map_init ? t[e] = setInterval(function () { "function" == typeof et_pb_map_init && (et_pb_map_init(o[e]), clearInterval(t[e])) }, 1e3) : et_pb_map_init(jQuery(this)) }) } }), jQuery("#dmach-modal-wrapper.loading").length) { var t = jQuery("#loading-modal").attr("modaldata-id"); jQuery("#dmach-modal-wrapper").removeClass("loading"), jQuery("#loading-modal").removeClass("open"), jQuery("#post-modal-" + t).addClass("open") } jQuery("#dmach-modal-wrapper").append(a.css_output); var o = jQuery(".divi-filter-archive-loop.main-archive-loop"); if (o.find(".grid-col").find(".gallery_vars").length > 0) { var s = o.find(".grid-col").find(".gallery_vars").attr("data-gallery_vars"), i = o.find(".grid-col").find(".gallery_vars").attr("data-gallery_type"); if (s = "{" + (s = (s = (s = s.replace(/,\s*$/, "")).replace(/,/g, ", ")).replace(/'/g, '"')) + "}", s = JSON.parse(s), jQuery(".et_pb_de_mach_acf_slider_containter").each(function (a, e) { jQuery(this).slick("unslick"), jQuery(this).slick(s) }), "gallery" == i) { var d = o.find(".grid-col").find(".gallery_vars").attr("data-gallery_nav"); d = "{" + (d = (d = (d = d.replace(/,\s*$/, "")).replace(/,/g, ", ")).replace(/'/g, '"')) + "}", (d = JSON.parse(d)).asNavFor = ".et_pb_de_mach_acf_slider_containter", d.focusOnSelect = !0, jQuery(".et_pb_de_mach_acf_slider_containter_nav").each(function (a, e) { jQuery(this).slick("unslick"), jQuery(this).slick(d) }) } } jQuery(".et_pb_gallery_image a").magnificPopup({ type: "image" }), resizeAllGridItems(), jQuery("#dmach-modal-wrapper .dmach-popup").each(function (a, e) { jQuery(this).find(".wpcf7-form").length > 0 && wpcf7.init(jQuery(this).find(".wpcf7-form")) }) } }) } } function same_height_cards() { jQuery(".same-height-cards .filtered-posts").each(function () { var a = 0; jQuery(".grid-col", this).each(function () { jQuery(this).height() > a && (a = jQuery(this).height()) }); var e = jQuery(this).find(".et_pb_section").css("marginBottom"); jQuery(".grid-col", this).height(a), jQuery(".grid-col", this).css("margin-bottom", e) }) } jQuery(document).ready(function (a) { a(document.body).on("click", ".et_pb_de_mach_search_posts .et_pb_button", function () { a(this).closest(".et_pb_de_mach_search_posts").find("#dmach-search-form").submit() }), a(".align-last-module").each(function () { var e = a(this); if (console.log(e), e.find(".slick-list").length) { var t = 0; jQuery(".slick-slide:nth-child(1) .et_pb_section .et_pb_row").each(function () { t++ }), t > 1 ? e.addClass("align-multiple_rows") : e.addClass("align-single_row") } else e.find(".divi-filter-archive-loop .et_pb_row:nth-child(2)").length > 1 ? e.addClass("align-multiple_rows") : e.addClass("align-single_row") }), a(document.body).on("click", ".dmach-link-whole-grid-card", function () { var e = a(this).data("link-url"); window.location.href = e }), main_count = Number(0), a(".dmach-search-items").each(function (e, t) { main_count = Number(0), a(this).children(".et_pb_de_mach_search_posts_item").each(function (e, t) { var o = Number(a(this).find(".search_filter_cont").attr("data-count")); main_count += o, main_count >= "100" && (a(this).addClass("last-item"), main_count = Number(0)) }) }), a(".search_filter_cont").removeClass("hidden"), a(".button_container").removeClass("hidden"), a("#select_post_types").on("change", function () { var e = this.value; a("#search_post_type").val(e) }); var e = a(".filtered-posts").attr("data-columns"); a(".filtered-posts").find(".et_pb_column").addClass(e), a(window).click(function () { a(".et_pb_de_mach_search_posts_item").removeClass("visible") }), a(".et_pb_de_mach_search_posts_item").click(function (a) { a.stopPropagation() }), a(".dmach-filer-toggle .et_pb_contact_field_options_title ").click(function (e) { a(this).closest(".et_pb_de_mach_search_posts_item").hasClass("visible") ? a(".et_pb_de_mach_search_posts_item").removeClass("visible") : (a(".et_pb_de_mach_search_posts_item").removeClass("visible"), a(this).closest(".et_pb_de_mach_search_posts_item").addClass("visible")) }), a(".dmach-tag-cloud a").click(function (e) { var t = a(this).attr("class").match(/tag-link-[\w-]*\b/); a(this).closest(".dmach-tag-cloud").find("select").val(t), a(this).closest(".dmach-tag-cloud").find("select").trigger("change") }), get_post_popup() }), jQuery(document).on("touchstart click", ".dmach-popup .modal-close", function () { jQuery(this).closest(".dmach-popup").removeClass("open"), jQuery("body").css("overflow", "auto") }), jQuery(document).on("touchstart click", ".dmach-popup", function () { jQuery(this).closest(".dmach-popup").removeClass("open"), jQuery("body").css("overflow", "auto") }), jQuery(document).on("touchstart click", ".post-modal-cont", function (a) { a.stopPropagation() }), jQuery(document).on("touchstart click", ".dmach-next-post", function (a) { jQuery(this).closest(".dmach-popup").next(".dmach-popup").length ? (jQuery(this).closest(".dmach-popup").removeClass("open"), jQuery(this).closest(".dmach-popup").next(".dmach-popup").addClass("open")) : (jQuery(this).closest(".dmach-popup").removeClass("open"), jQuery("body").css("overflow", "auto")) }), jQuery(document).on("touchstart click", ".dmach-prev-post", function (a) { jQuery(this).closest(".dmach-popup").prev(".dmach-popup").length ? (jQuery(this).closest(".dmach-popup").removeClass("open"), jQuery(this).closest(".dmach-popup").prev(".dmach-popup").addClass("open")) : (jQuery(this).closest(".dmach-popup").removeClass("open"), jQuery("body").css("overflow", "auto")) });